package org.mcflier.appuntamento.io.driver.db.interfaces;

import java.util.List;

import org.mcflier.appuntamento.data.model.Movie;
import org.mcflier.appuntamento.io.exception.JDBCConnectionException;
import org.mcflier.appuntamento.io.exception.JDBCStatementException;
import org.mcflier.appuntamento.io.exception.JDBCTransactionException;

public interface IJDBCMovieDriver {
	
	public boolean addMovie(Movie movie, boolean useTransaction) throws JDBCConnectionException, JDBCStatementException, JDBCTransactionException;
	
	public int addMovies(List<Movie> movies);
	
	public boolean existsMovie(String id) throws JDBCConnectionException, JDBCStatementException;
	
	/**
	 * Check what movies are stored from a list containing movie ids. This method doesn't look for the language of the movie.
	 * @param ids The list with the movie ids to check
	 * @return A list with the movie ids stored on the database
	 * @throws JDBCConnectionException
	 * @throws JDBCStatementException
	 */
	public List<String> existMovies(List<String> ids) throws JDBCConnectionException, JDBCStatementException;
	
	public Movie getMovie(String id, String codeLanguage) throws JDBCConnectionException, JDBCStatementException;
	
	public List<Movie> getMovies(List<String> ids, String codeLanguage) throws JDBCConnectionException, JDBCStatementException;
	
	public boolean deleteMovie(String id, boolean useTransaction) throws JDBCTransactionException, JDBCStatementException, JDBCConnectionException;
	
	public boolean traceMovie(String id, boolean useTransaction);
}
